package com.hl.card.credit.service.impl;

import com.hl.card.credit.service.RabbitMQService;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RabbitMQServiceImpl implements RabbitMQService {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    @Override
    public String send(String queue, Object context) {
        System.out.println("Sender : " + context);
        this.rabbitTemplate.convertAndSend(queue, context);
        return "";
    }
}
